import React from 'react'
import { connect } from 'react-redux'
import { projectLabelView as projectDuck } from 'ducks'
import Group from './group'
import Block from './block'
import Label from './label'
import Item from './item'

const LabelDone = ({ isEditingLabel, actionResetEditAndDo }) => {
  console.log(!isEditingLabel)
  return (
    <Group title="Done">
      <Block>
        <Item disable={!isEditingLabel} action={() => actionResetEditAndDo()}>
          <img className="label-img32" src="https://png.icons8.com/color/2x/checkmark.png" alt="" />
          <br />
          <Label title="Label Done" />
        </Item>
      </Block>
    </Group>
  )
}

const mapStateToProps = state => ({
  isEditingLabel: projectDuck.selectors.isEditingLabel(state),
})

const mapDispatchToProps = {
  actionResetEditAndDo: projectDuck.creators.actionResetEditAndDo,
}

export default connect(mapStateToProps, mapDispatchToProps)(LabelDone)
